﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Ninject.Modules;
using NHibernate;
using Subtle.Data.Configuration;
using Ninject;

namespace Subtle.Modules
{
	public class SessionFactoryModule :NinjectModule
	{
		/// <summary>
		/// Load
		/// </summary>
		public override void Load()
		{
			Bind<ISessionFactory>().ToConstant(SessionFactoryBuilder.SessionFactory);
			Bind<ISession>().ToMethod(x => Kernel.Get<ISessionFactory>().OpenSession()).InRequestScope();
		}
	}
}